package com.bdqn.t330.controller;


import com.bdqn.t330.entity.Right;
import com.bdqn.t330.mapper.RightMapper;
import com.bdqn.t330.service.RightService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/right")
public class RightController {

    @Resource
    RightMapper rightMapper;

    @Resource
    RightService rightService;

    @ResponseBody
    @RequestMapping("/get")
    public Object get(String rightCode) {
        Right right = new Right();
        right.setRightCode(rightCode);
        right.setRightUrl("http://www.baidu.com");
        return right;
    }

    @ResponseBody
    @RequestMapping("/rightCode")
    public Object rightCode(String rightCode) {
        return rightService.getById(rightCode);
    }
}
